Lego Sherlock Holmes figure focuses a light beam on a Lego criminal with a small magnifying glass.

Raspberry Pi Mindstorms

The BrickPi and GrovePi can be stacked on a Raspberry Pi.

I love the EV3 Intelligent Brick--it’s one of the great inventions of the 21st Century. But I wanted to explore other microcontrollers that can be connected to LEGO, maybe to add video and internet capability to LEGO inventions. So I checked into the Raspberry Pi. The good folks at Dexter Industries (dexterindustries.com) sent me their BrickPi to try out. This is a hat that rides on the header pins of the Raspberry Pi to allow the connection of Mindstorms motors and sensors. But noting that hats can be stacked on top of each other, I also got a GrovePi that allows connection of Grove (seeedstudio.com) sensors. The resulting RaspberryPi/BrickPi/GrovePi stack is shown in the photo above. The base of the stack is attached to a plate that Dexter Industries supplies as a case for the BrickPi. I’m just using the base plate of the case here, since I also stacked on a GrovePi. The bottom base plate can be attached to LEGO bricks.

I was entirely new to the Raspberry Pi, so it took me a while to find my way around. It’s really a full-up computer. But with so much possibility, it takes some work to figure things out. A custom Raspberry Pi operating system from Dexter Industries, called Raspbian for Robots, helped much in getting setup for my desired application of LEGO inventions. Raspbian for Robots includes software modules and examples for interfacing both BrickPi and GrovePi to sensors and motors. There are several programming languages that will work with Raspberry Pi, and I chose Python. I was also new to Python programming, and I had to study a couple books to get to a working knowledge. But it’s worth the effort, as there are vast creative possibilities with Python and Raspberry Pi. Python is a line-by-line programming environment, reminding of my first computer (a Radio Shack TRS-80 purchased in 1983) that was programmed in BASIC and my later university days of Pascal. Turbo Pascal was the hot new computer language circa 1986, but went out of favor a few years later.

To connect to LEGO structures I found another case in addition to the package pictured above. A design by Smarticase (smarticase.com) called Smarti Pi Touch allows packaging of a touch screen and Raspberry Pi (with stack of hats), along with attachment points for LEGO bricks on both the front and back. A photo of the back of the Smarti Pi Touch is shown below, with my stack of RaspberryPi/BrickPi/GrovePi. Smarticase also makes a LEGO-compatible enclosure for a Raspberry Pi camera. This setup forms a sort of high-tech LEGO workstation. I’ve got example projects to post soon.



The Raspberry Pi/BrickPi/GrovePi are attaced to the back of a Smarti Pi Touch.